#include<bits/stdc++.h>
using namespace std;
const int MAXN=5e5+10;
int n,i;
char a[MAXN];
struct node
{
	int a,b;
};
node dfs1()
{
	++i;
	if(a[i]=='0')return (node){1,0};
	if(a[i]=='1')
	{
		node t=dfs1();
		return (node){t.b+1,t.a};
	}
	node t1=dfs1(),t2=dfs1();
	return (node){t1.b+t2.b+1,max(t1.a+t2.b,t2.a+t1.b)};
}
node dfs2()
{
	++i;
	if(a[i]=='0')return (node){1,0};
	if(a[i]=='1')
	{
		node t=dfs2();
		return (node){t.b+1,min(t.a,t.b)};
	}
	node t1=dfs2(),t2=dfs2();
	return (node){t1.b+t2.b+1,min(t1.a+t2.b,t2.a+t1.b)};
}
int main()
{
	scanf("%s",a+1);
	n=strlen(a+1);
	i=0;
	node t=dfs1();
	printf("%d ",max(t.a,t.b));
	i=0;
	t=dfs2();
	printf("%d\n",min(t.a,t.b));
	return 0;
}
